package v1

import (
	"github.com/gogf/gf/v2/frame/g"
	"wh-1-backend/internal/model"
	"wh-1-backend/internal/model/entity"
)

type GetProjectPageListReq struct {
	g.Meta `path:"/projects" tags:"Project" method:"get" summary:"项目"`
	Title  string `json:"title" v:"length:1,20"`
	PageCommonReq
}

type GetProjectPageListRes struct {
	Total int                        `json:"total"`
	List  []*model.SimpleProjectList `json:"list"`
}

type EditProjectReq struct {
	CompanyId              uint   `json:"companyId" v:"required"          `                 //
	Contact                string `json:"contact" v:"required|length:1,32"                ` //
	Title                  string `json:"title" v:"required|length:1,32"                  ` //
	IndustryId             uint   `json:"industryId"             `                          //
	FunctionId             uint   `json:"functionId"             `                          //
	CityId                 uint   `json:"cityId"                 `                          //
	Address                string `json:"address"                `                          //
	StatusId               uint   `json:"statusId" v:"required"              `              //
	StartAt                string `json:"startAt" v:"required|date"               `         //
	EndAt                  string `json:"endAt" v:"required|date"                 `         //
	EnterpriseBackgroundId uint   `json:"enterpriseBackgroundId" `                          //
	NationalityId          uint   `json:"nationalityId"          `                          //
	EducationBackgroundId  uint   `json:"educationBackgroundId" `                           //
	MaxAge                 int    `json:"maxAge"                 `                          //
	MinAge                 int    `json:"minAge"                 `                          //
	MaxWorkAge             int    `json:"maxWorkAge"             `                          //
	MinWorkAge             int    `json:"minWorkAge"             `                          //
	MaxSalary              int    `json:"maxSalary"              `                          //
	MinSalary              int    `json:"minSalary"              `                          //
	Gender                 uint   `json:"gender"                 `                          //
	RecruitReason          uint   `json:"recruitReason"          `                          //
	InsideOpenAt           string `json:"insideOpenAt" v:"date"          `                  //
	DptStatus              uint   `json:"dptStatus"              `                          //
	ReportFor              string `json:"reportFor"              `                          //
	IsSole                 uint   `json:"isSole"                 `                          //
	IsAdd                  uint   `json:"isAdd"                  `                          //
	IsSecrecy              uint   `json:"isSecrecy"              `                          //
	CoreProblem            string `json:"coreProblem"            `                          //
	JobStyle               string `json:"jobStyle"               `                          //
	HardRequirement        string `json:"hardRequirement"        `                          //
	Precedence             string `json:"precedence"             `                          //
	SalaryModel            string `json:"salaryModel"            `                          //
	JobDes                 string `json:"jobDes"                 `                          //
	JobSuperiority         string `json:"jobSuperiority"         `                          //
	InterviewModel         string `json:"interviewModel"         `                          //
	Direction              string `json:"direction"              `                          //
	PresentSituation       string `json:"presentSituation"       `                          //
	Target                 string `json:"target"                 `                          //
}

type CreateProjectReq struct {
	g.Meta `path:"/project" tags:"Project" method:"post" summary:"项目"`
	EditProjectReq
}

type ModifyProjectReq struct {
	g.Meta `path:"/project/{Id}" tags:"Project" method:"put" summary:"项目"`
	Id     uint `json:"id" in:"path" v:"required"`
	EditProjectReq
}

type DeleteProjectReq struct {
	g.Meta `path:"/project" tags:"Project" method:"delete" summary:"项目"`
	Ids    []uint `json:"ids" v:"required"`
}

type GetProjectDetailReq struct {
	g.Meta `path:"/project/{Id}" tags:"Project" method:"get" summary:"项目"`
	Id     uint `json:"id" in:"path" v:"required"`
}

type GetProjectDetailRes struct {
	*entity.Project
}

type ProjectAttachResumeReq struct {
	g.Meta    `path:"/project/{ProjectId}/attach" tags:"Project" method:"post" summary:"项目"`
	ProjectId uint   `json:"projectId" in:"path" v:"required"`
	Ids       []uint `json:"ids" v:"required|array"`
}

type ProjectUnAttachResumeReq struct {
	g.Meta    `path:"/project/{ProjectId}/unattach/{Id}" tags:"Project" method:"post" summary:"项目"`
	ProjectId uint `json:"projectId" in:"path" v:"required"`
	Id        uint `json:"id" in:"path" v:"required"`
}

type GetProjectResumeReq struct {
	g.Meta    `path:"/project/{ProjectId}/resumes" tags:"Project" method:"get" summary:"项目"`
	ProjectId uint   `json:"projectId" in:"path" v:"required"`
	Username  string `json:"username" v:"length:1,20"`
	Phone     string `json:"phone" v:"length:1,11"`
	PageCommonReq
}

type GetProjectResumeRes struct {
	Total int                        `json:"total"`
	List  []*model.ProjectResumeList `json:"list"`
}
